serde-error
serde-error
provides a (de)serializable Error
type implementing
std::error::Error
, that can easily be used to transmit errors over
the wire.
Should I use this?
This crate is production-grade. However, you probably do not want to use it: usually, it makes much more sense to just sum up the error as some type, instead of serializing the whole causality chain.
The use case for which this crate was designed is running Rust WebAssembly blobs inside a Rust wasmtime-running host. In such a case the causality chain is clearly kept across the serialization boundary, and it thus makes sense to keep it all.
In some other cases it may make sense to serialize the whole causality chain, but most often it makes most sense to just not serialize errors.
As such, please use serde-error
with parsimony.
How should I use this?
use Context;
use Error;